package com.RedRiver.hospitalsystem.record_service.client;

import com.RedRiver.hospitalsystem.record_service.client.param.AddResultParam;
import com.RedRiver.hospitalsystem.record_service.client.param.CreateRecordParam;
import com.RedRiver.hospitalsystem.record_service.client.result.SearchRecordByIdResult;
import com.RedRiver.hospitalsystem.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import javax.validation.Valid;
import java.util.List;

@FeignClient(contextId = "RecordsClient",name="record-service",path="recordService/records")
public interface RecordsClient {

    @PostMapping("/createRecord")
    public Result<?> createRecord(@RequestBody @Valid CreateRecordParam recordParam);

    @GetMapping("/searchRecordByid")
    public Result<List<SearchRecordByIdResult>> searchRecordByid(Integer id);

    @PostMapping("/addRecordResult")
    public Result<?> createRecordResult(@RequestBody @Valid AddResultParam resultParam);

}
